package com.cloudwise.controller;

import com.cloudwise.entity.Dept;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * @author ：Teacher陈
 * @date ：Created in 2020/12/11 10:14
 * @description：我的业务控制器
 * @modified By：
 * @version: 1
 */
@Controller
public class MyController {
    @RequestMapping("/toHelloPage")
    public String toHelloPage(HttpSession session,Dept dept){
      /*  Dept dept= new Dept(111,"国防部","郑州");*/
        session.setAttribute("dept",dept);
        return "hello";
    }
    @RequestMapping("/getJson")
    @ResponseBody
    public Dept getJson(){
        Dept dept= new Dept(111,"国防部","郑州");
        return dept;
    }

}
